<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<c:if test="${not empty ctgList and fn:length(ctgList) gt 0}">
	<c:forEach items="${ctgList}" var="ctg" varStatus="status">
	  	  <c:choose>
	  	  	<c:when test="${!ctg.leaf}">
				 <div class="category-accordion">
	  	  			<label class="font-14 non-leaf" category="${ctg.id}"><c:out value="${ctg.name}" escapeXml="false"/> [<span class="count">0</span>]</label>	
	 					 <c:set var="ctgList" value="${ctg.children}" scope="request"/>
	  				 <div class="content" category="${ctg.id}">
						<jsp:include page="/WEB-INF/modules/category-list.jsp"/>	  	  		  	  		
	  				 </div>
				 </div>
	  	  	</c:when>
	  	  	<c:otherwise>
	  	  		<c:set var="selected" value=""/>
				<c:forEach items="${business.categories}" var="selectedCateg">
					  	<c:if test="${ctg.id eq selectedCateg.id}">
						  <c:set var="selected" value="checked"/>
					  	</c:if>
				  </c:forEach>	  	  	
	  	  		<div class="category-leaf <c:if test='${status.count%2 eq 0}'>even</c:if>">
		  	  		<input type="checkbox" name="categories" value="${ctg.id}" id="category-${ctg.id}" ${selected} ${field_property}/>
		  	  		<label class="font-14 font-normal" for="category-${ctg.id}"><c:out value="${ctg.name}" escapeXml="false"/></label>
	  	  		</div>
	  	  	</c:otherwise>
	  	  </c:choose>
	</c:forEach>
 </c:if>
